** Replication Code for:
** Terrorism Activates Ethnocentrism to Explain Greater Willingness to 
** Sacrifice Civil Liberties: Evidence from Germany
** Authors: Christina Novak Hansen and Peter Thisted Dinesen 
** Date: 10/02/2021

*-------------------------------------------------------------------------------

clear all
use GGSS2016_analysis.dta
svyset xs11 [pweight=wghtpew], vce(linearized)

keep if german==1 & governmentsplit!=.	


*-------------------------------------------------------------------------------
*Appendix T: Additional robustness check: The influence of living in Bavaria
*-------------------------------------------------------------------------------

/*The following alayses are based on the variables included in the main models 
(Table 1, Model 1-3)*/.



		
*-------------------------------------------------------------------------------

*Which federal states are represented in the pre-attack and post-attacks groups?
tab land treatment1, column
tab statedummy treatment1

	****Main regression controlling for the influence of living in Bavaria***
								*Table T1*
							
*The following regressions account for the influence of living in Bavaria
*Full ethnocentrism index and civil liberties with reference to terrorism
svy: regress st_terrori statedummy c.st_ethno i.sex st_age st_age2 i.proedu2 i.work2 if treatment1!=.
outreg2 using Table_T1.xls, drop(i.sex st_age st_age2 i.proedu2 i.work2) nocons stats(coef se) dec(2) symbol(**,*) alpha(0.01,0.05) label replace 
svy: regress st_terrori statedummy c.st_ethno i.treatment1 i.sex st_age st_age2 i.proedu2 i.work2 if treatment1!=. 
outreg2 using Table_T1.xls, drop(i.sex st_age st_age2 i.proedu2 i.work2) nocons stats(coef se) dec(2) symbol(**,*) alpha(0.01,0.05) label append 
svy: regress st_terrori statedummy c.st_ethno##i.treatment1 i.sex st_age st_age2 i.proedu2 i.work2 if treatment1!=. 
outreg2 using Table_T1.xls, drop(i.sex st_age st_age2 i.proedu2 i.work2) nocons stats(coef se) dec(2) symbol(**,*) alpha(0.01,0.05) label append


*-------------------------------------------------------------------------------



			****Regressions predicting number of contacts attempts***
								*Table T2*

*Number of contacts via telephone (xs08)
svy: regress st_phone statedummy i.treatment1 i.sex st_age st_age2 i.proedu2 i.work2 if st_terrori!=. & st_ethno!=.
outreg2 using Table_T2.xls, nocons stats(coef se) dec(2) symbol(**,*) alpha(0.01,0.05) label replace 
*Number of contacts via visits (xs09)
svy: regress st_housevisits statedummy i.treatment1 i.sex st_age st_age2 i.proedu2 i.work2 if st_terrori!=. & st_ethno!=.
outreg2 using Table_T2.xls, nocons stats(coef se) dec(2) symbol(**,*) alpha(0.01,0.05) label append 
*Number of contacts, other (xs13)
svy: regress st_othercontacts statedummy i.treatment1 i.sex st_age st_age2 i.proedu2 i.work2 if st_terrori!=. & st_ethno!=.
outreg2 using Table_T2.xls, nocons stats(coef se) dec(2) symbol(**,*) alpha(0.01,0.05) label append


*-------------------------------------------------------------------------------
